package zisu.netty.practice.RSocket;

import lombok.extern.slf4j.Slf4j;
import org.springframework.messaging.handler.annotation.MessageMapping;
import org.springframework.messaging.handler.annotation.Payload;
import org.springframework.stereotype.Controller;
import reactor.core.publisher.Mono;

/**
 * @Desc: ""
 * @Author: caixiang
 * @DATE: 2021/1/22 10:01
 */
@Controller
@Slf4j
public class RSocketController {
    //https://mp.weixin.qq.com/s/47yxrtTZlYzBomAieOdxOA 参考
    @MessageMapping("request-response")
    Mono<String> reqResponse(@Payload String payload) {
        log.info("收到 RR 请求信息: {}", payload);
        return Mono.just("Hello, " + payload);
    }
}
